Skip to content

Conversation

drleavio
Copy link

Added logic for express and react

☕️ Reasoning

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

📌 Resources

Added logic for express and react
@drleavio drleavio requested a review from ndom91 as a code owner May 14, 2025 08:39
Copy link

vercel bot commented May 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
auth-docs ❌ Failed (Inspect) May 14, 2025 8:42am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
next-auth-docs ⬜️ Ignored (Inspect) Visit Preview May 14, 2025 8:42am

Copy link

vercel bot commented May 14, 2025

@drleavio is attempting to deploy a commit to the authjs Team on Vercel.

A member of the Team first needs to authorize it.

Comment on lines +489 to +524
<Code.ExpressClient>
```tsx filename="Login.tsx"
import { useState } from 'react';
import axios from 'axios';

const Login = () => {
const [email, setEmail] = useState('');
const [message, setMessage] = useState('');

const handleSendLink = async () => {
try {
const res = await axios.post('/auth/login', { email });
setMessage(res.data.message);
} catch (err: any) {
setMessage(err.response?.data?.error || 'Error sending link');
}
};

return (
<div>
<h2>Login with Magic Link</h2>
<input
type="email"
placeholder="Enter your email"
value={email}
onChange={(e) => setEmail(e.target.value)}
/>
<button onClick={handleSendLink}>Send Magic Link</button>
<p>{message}</p>
</div>
);
};

export default Login;
```
</Code.ExpressClient>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ExpressClient tab hasn’t been set yet. Tabs are managed by the main maintainers and are typically added when documentation reflects new framework support in auth.js, or when previously disabled tabs are reactivated.
For reference, you can check how tabs are handled here:

Code.Next = NextCode
Code.NextClient = NextClientCode
Code.Svelte = SvelteCode
// Code.Solid = SolidCode;
Code.Express = ExpressCode
Code.Qwik = QwikCode
const baseFrameworks = {
[NextCode.name]: "Next.js",
[QwikCode.name]: "Qwik",
[SvelteCode.name]: "SvelteKit",
[ExpressCode.name]: "Express",
// [SolidCode.name]: "SolidStart",
}
const allFrameworks = {
[NextCode.name]: "Next.js",
[NextClientCode.name]: "Next.js (Client)",
[QwikCode.name]: "Qwik",
[SvelteCode.name]: "SvelteKit",
// [SolidCode.name]: "SolidStart",
[ExpressCode.name]: "Express",
}

In the meantime, please move the code currently under the ExpressClient tab into the existing Express tab, and mention its usage within a React app context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants